//
//  CBVedioModel.m
//  CultureBreath
//
//  Created by lanou on 15/10/24.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CBVedioModel.h"

@implementation CBVedioModel

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.consumptionModel = [[CBConsumptionModel alloc]init];
        self.playArray = [NSMutableArray array];
    }
    return self;
}

-(void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"consumption"]) {
        [self.consumptionModel setValuesForKeysWithDictionary:value];
    }else if ([key isEqualToString:@"playInfo"])
    {
        for (NSDictionary *dic in value) {
            CBPlayInfo *playInfo = [[CBPlayInfo alloc]init];
            [playInfo setValuesForKeysWithDictionary:dic];
            [self.playArray addObject:playInfo];
        }
    }else if ([key isEqualToString:@"description"])
    {
        self.desc = value;
    }else
    {
        [super setValue:value forKey:key];
    }
}


@end
